Skip to content

fix(id): cap inbound /ws/tags messages - #3371

Merged
dezren39 merged 2 commits into
mainfrom
queue/5099-2116-tags-ws-cap
Nov 2, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/5099-2116-tags-ws-cap

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

ws_tags_handler now applies the shared 1 MiB MAX_FRAME_BYTES limit before upgrading /ws/tags:

WebSocketUpgrade
  max_message_size(MAX_FRAME_BYTES)
  on_upgrade(handle_tags_socket)

A wire-level regression test checks ping/pong, outbound tag-event delivery, and connection termination after a message exceeds the cap.

Evidence

  • Before: the handler upgraded without a message limit; the drain task received complete messages and ignored all but Close.
  • After: the upgrade limits messages to the repository's existing 1 MiB WebSocket convention.
  • git diff --check passes. The focused Rust test is being retried after the first build stopped before compiling this crate because the filesystem ran out of space; CI will provide an isolated check.

Merge Danger

Door: Two-way — the cap can be adjusted or reverted.

Blast Radius: Narrow — only inbound message size for /ws/tags changes; normal outbound events are covered by the test.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 06:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T06:24:15.129777Z f772a44 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f03b5db3-f41e-439f-a1cd-eee2cfe56088
Commits

Reviewing files that changed from the base of the PR and between ee8bc80 and f772a44.

Files selected for processing: 1
  • pkgs/id/src/web/tags_ws.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f772a44794

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +680 to +682
let closed = tokio::time::timeout(Duration::from_secs(5), client.next())
.await
.expect("oversized message did not close the WebSocket");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Terminate the socket handler when the inbound reader exits

After the oversized message triggers a capacity error, handle_tags_socket exits only its inbound drain task. The forwarding loop remains blocked on rx.recv() while retaining the socket's write half, so neither a close frame nor transport closure reaches the client. With no subsequent tag events, this newly added test times out here. Observe drain-task completion in the forwarding loop and drop or close the remaining socket half when the reader terminates.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant